package com.lancoo.edu.platform.operation.commons.utils;

import org.springframework.util.DigestUtils;

/**
 * @author lizxing
 * @date 2021/2/19
 *
 * MD5加密
 */
public class LancooMd5HashUtil {

    /**
     * MD5 后反转
     * @param sysId 明文
     * @return 反转后的密文
     */
    public static String getSecCodeByReverseMd5(String sysId) {
        String md5 = DigestUtils.md5DigestAsHex(sysId.getBytes());
        StringBuilder buffer = new StringBuilder(md5);
        return buffer.reverse().toString();
    }

    public static String getSecCodeByMd5(String sysId) {
        return DigestUtils.md5DigestAsHex(sysId.getBytes());
    }
}
